<?php
$q = isset($_GET["q"]) ? intval($_GET["q"]) : '';
if(empty($q)) {
    echo '请选择一个号码';
    exit;
}
$con = mysqli_connect('localhost','root','');
if (!$con)
{
    die('Could not connect: ' . mysqli_error($con));
}
// 选择数据库
mysqli_select_db($con,"uml");
// 设置编码，防止中文乱码
mysqli_set_charset($con, "utf8");

$sql="SELECT * FROM playertable WHERE playerId = '$q'";

$result = mysqli_query($con,$sql);
$rows=mysqli_fetch_all($result);
echo json_encode($rows);

mysqli_close($con);
?>
